﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace BoriPeter.FatSecret.Models
{
    /// <summary>
    /// Returns the daily exercise entries for the user on a nominated date.
    /// The API will always return 24 hours worth of exercise entries for a given user on a given date. 
    /// These entries will either be "template" entries (which a user may override for any given day of the week) 
    /// or saved exercise entry values
    /// </summary>
    [XmlRoot("exercise_entries", Namespace = "http://platform.fatsecret.com/api/1.0/")]
    public class ExerciseEntriesGetModel
    {
        /// <summary>
        /// The exercise entries returned contain the time undertaken and energy 
        /// consumed for each activity for a user on the nominate date as follows:
        /// </summary>
        [XmlElement("exercise_entry")]
        public ExerciseEntriesGetEntry[] Entries { get; set; }
    }

    public class ExerciseEntriesGetEntry
    {
        /// <summary>
        /// exercise_id – the unique exercise identifier.
        /// </summary>
        [XmlElement("exercise_id")]
        public int ExreciseId { get; set; }

        /// <summary>
        /// the name of the exercise - where the exercise_id is '0' this is a user entered description.
        /// </summary>
        [XmlElement("exercise_name")]
        public string ExerciseName { get; set; }

        /// <summary>
        /// minutes is an Int – the duration of the activity in minutes (for a total of 1440 minutes/day).
        /// </summary>
        [XmlElement("minutes")]
        public int Minutes { get; set; }

        /// <summary>
        /// is an Decimal – the estimated energy consumed per activity in kcal, 
        /// based on the user's weight – where the exercise_id is '0' this is a user entered value.
        /// </summary>
        [XmlElement("calories")]
        public decimal Calories { get; set; }
    }
}
